<%-- 
    Document   : index
    Created on : 08-abr-2011, 17:48:32
    Author     : Alberto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" class="cufon-active cufon-ready">
    <head>
        <title>UAO</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/cufon-yui.js"></script>
        <script type="text/javascript" src="js/arial.js"></script>
        <script type="text/javascript" src="js/cuf_run.js"></script>
    </head>
    <body>
        <div class="main">
            <div class="header">
                <div class="header_resize">
                    <div class="logo">
                        <h1><a href="#">UAO <span></span></a><small>University Accomodation Office</small></h1>
                    </div>
                    <div class="clr"></div>
                    <div class="menu_nav">
                    </div>
                    <div class="clr"></div>
                </div>
            </div>

        </div>
        <div class="clr"></div>
        <br /><br />
        <form action="./Login" method="POST" id="login">
            <table>
                <tr>
                    <td>Nombre de usuario: </td><td><input type="text" name="username" size="50"></td><br />
                </tr>
                <tr>
                    <td>Password: </td><td><input type="password" name="password" size="20"></td><br />
                </tr>
            </table>
            <input type="button" value="Acceso" onclick="valida_formulario('login')">
        </form>

        <div class="footer">
            <div class="clr"></div>
        </div>
        <script language="javascript">
            function valida_formulario(nom)
            {
                x = document.getElementById(nom).username.value;
                atpos=x.indexOf("@");
                dotpos=x.lastIndexOf(".");
                if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
                {
                    alert("Dirección de correo electrónico no válido");
                    return false;
                }
                document.getElementById(nom).submit();
            }
        </script>

</body>
</html>
